<template>
    <div>
        <h1>职员管理显示</h1>
        姓名 <input type="text" v-model="info.names">
        职员类型
        <select v-model="info.posts">
            <option value="">请选择</option>
            <option value="项目经理">项目经理</option>
            <option value="财务总监">财务总监</option>
            <option value="普通职员">普通职员</option>
        </select>
        <input type="button" value="查询" @click="getlist">
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>Id</td>
                    <td>姓名</td>
                    <td>职员类型</td>
                    <td>性别</td>
                    <td>身份证号</td>
                    <td>手机号</td>
                    <td>管理小区</td>
                </tr>

                <tr v-for="itme in data.list" :key="itme.Id">
                    <td>{{ itme.Id }}</td>
                    <td>{{ itme.Name }}</td>
                    <td>{{ itme.posts }}</td>
                    <td>{{ itme.Sex == true ? "男" : "女" }}</td>
                    <td>{{ itme.Sfzh }}</td>
                    <td>{{ itme.Phone.substring(0, 3) + '****' + itme.Phone.substring(7) }}</td>
                    <td>{{ itme.Guanli }}</td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import axios from 'axios';
import { useRouter } from 'vue-router';
const rouder = useRouter();
let info: any = reactive({
    names: '',
    posts: ''
})
let data: any = reactive({
    list: []
})
onMounted(() => {
    getlist();
})
const getlist = () => {
    axios({
        url: '/api/Wook/GetShow',
        method: 'get',
        params: info
    })
        .then((res) => {
            console.log(res);
            data.list = res.data
        })
        .catch((err) => {
            console.log(err);

        })
}
</script>

<style scoped></style>